package ua.com.alus.resvac.crm.services.spring;

import org.apache.lucene.queryParser.ParseException;
import org.springframework.security.access.annotation.Secured;
import ua.com.alus.resvac.crm.domen.entities.BaseEntity;
import ua.com.alus.resvac.crm.domen.prototype.DocType;
import ua.com.alus.resvac.crm.util.search.Search;

import java.io.IOException;
import java.util.List;

/**
 * Lucene service
 *
 * @author Usatov Alexey
 */
public interface LuceneService {
    @Secured({"ROLE_RESUME", "ROLE_VACANCY"})
    void indexRecord(BaseEntity baseEntity) throws IOException, ParseException;

    @Secured({"ROLE_RESUME", "ROLE_VACANCY"})
    List<String> search(Search search) throws IOException, ParseException;

    @Secured({"ROLE_RESUME", "ROLE_VACANCY"})
    void deleteRecord(String index, DocType docType) throws IOException, ParseException;
}
